﻿namespace HuaskyWebAPI.Common.Redis;

/// <summary>
/// Redis帮助函数，不对外公开
/// </summary>
class RedisConfig
{
	public static string GetFullKey(string group, string key)
	{
		return $"HuaskyWebAPI:{group}:{key}";
	}

	public static void ValidateFullKey(string key)
	{
#if DEBUG
		if (!key.StartsWith("HuaskyWebAPI"))
		{
			throw new InvalidDataException("invalid redis key: " + key);
		}
#endif
	}
}